package com.atguigu.gmall.api;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

//降级统一的异常处理
@Component
public class MyServiceFallbackFactory implements FallbackFactory<MyService> {

    public MyService create(Throwable throwable) {
        return new MyService(){
            public String getTesta() {
                return "被降级了+getTesta";
            }
            public String getTestb(){
                return "被降级了+getTestb";
            }
        };
    }
}
